<%-- 
    Document   : detail
    Created on : 2014-9-5, 11:59:05
    Author     : chensy
--%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" session="false" %>
<%@ include file="/WEB-INF/jspf/import.jspf" %>  
<!doctype HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
        <title>车友会</title>
        <meta name="keywords" content="" />
        <meta name="description" content="http://js.3conline.com/wap/pcauto/2014/" />
        <meta name="author" content="lianglixing_gz none" />
        <link rel="stylesheet" type="text/css" href="http://js.3conline.com/wap/pcauto/2014/cheyouhui/css/cyh.css">
    </head>

    <body>
        <!--栏目计数器/文章计数器-->
         <jsp:include page="/template/wap/common/counter.jspf">
            <jsp:param name="channel" value="7695" />
        </jsp:include>
        <div class="g-doc" id="J-main"> 
            <!-- 公共头部 --> 
           <%@include file="../common/intf6007.html" %>
            <!-- 公共头部end -->

            <div class="header-bg">
                <a href="javascript:history.go(-1);" class="header-back" title="太平洋汽车网"></a>
                <div class="header-title">
                    <span class="header-title-nav">
                        <c:choose>
                            <c:when test="${referType==1}"><a href="${WAPROOT}/">车友会</a>&nbsp;&gt;&nbsp;<a href="${WAPROOT}/tongcheng/">同城</a>&nbsp;&gt;&nbsp;动态</c:when>
                            <c:otherwise><a href="${WAPROOT}/">车友会</a>&nbsp;&gt;&nbsp;<a href="${WAPROOT}/${myUrl}/"> ${fn:length(fn:escapeXml(club.name))>8?fn:substring(fn:escapeXml(club.name),0,8):fn:escapeXml(club.name)}${fn:length(fn:escapeXml(club.name))>8?"...":""}</a></c:otherwise>
                        </c:choose>
                    </span>
                </div>
                <c:if test="${user!=null && user.uid>0 && isMember}"><a href="${WAPROOT}/${myUrl}/postDyna/" class="g-hd-btn" id="Jadd"></a></c:if>
                </div>

                <div class="wapper">     
                    <div class="section m-detail">
                        <ul class="list">
                            <li class="item">
                                <a href="${UCWAPROOT}/${dynaInfo.createBy}/" class="myIcon">
                                <img src="${f:face(dynaInfo.createBy, 50)}" width="50" height="50"/>
                            </a>
                            <div class="item-con">
                                <p class="des">
                                <c:choose>
                                    <c:when test="${dynaInfo.type == 8}">
                                        <strong><a href="${UCWAPROOT}/${dynaInfo.createBy}/">${dynaInfo.createName}</a></strong>创建了车友会
                                                <strong><a href="${WAPROOT}/${club.clubUrl}/">${fn:escapeXml(club.name)}</a></strong>，大家快去邀请车友加入吧！
                                    </c:when>
                                    <c:when test="${dynaInfo.type == 7}">
                                    <strong><a href="${UCWAPROOT}/${dynaInfo.createBy}/">${dynaInfo.createName}</a></strong>已经加入了
                                                <strong><a href="${WAPROOT}/${club.clubUrl}/">${fn:escapeXml(club.name)}</a></strong>车友会，欢迎大家来围观！
                                    </c:when>
                                    <c:when test="${dynaInfo.type == 3}">
                                        ${dynaInfo.createName}上传了${pictureNum}张相片到《${album.name}》
                                    </c:when>
                                    <c:otherwise>
                                        ${content}
                                    </c:otherwise>
                                </c:choose>
                                </p>
                                <div class="picsBox">
                                    <ul class="pics_9">
                                        <c:if test="${imagesLength>1 && imagesLength<=9 && imagesLength!=4}">
                                            <c:forEach var="img" items="${dynaInfo.images}">

                                                <li>
                                                    <img width="74" height="74" src="${f:transPicUrl(img.url500x500,150,150)}" data-meta="${img.url400x400}" alt="">
                                                </li>
                                            </c:forEach>
                                        </c:if>
                                        <c:if test="${imagesLength==4}">
                                            <li>
                                                <c:forEach var="img" items="${dynaInfo.images}" varStatus="status">
                                                    <img width="74" height="74" src="${f:transPicUrl(img.url500x500,150,150)}" data-meta="${img.url400x400}" alt="">
                                                    <c:if test="${status.count%2==0}"></li><li></c:if>
                                                </c:forEach>
                                            </c:if>
                                            <c:if test="${imagesLength==1}">
                                            <li>
                                                <c:forEach var="img" items="${dynaInfo.images}">

                                                    <c:if test="${img.width>img.height}">
                                                        <c:if test="${img.height<90}">
                                                            <c:if test="${img.width>300}">
                                                                <img width="150" height="<fmt:formatNumber value="${(img.height/(img.width/300))/2}" pattern="#"></fmt:formatNumber>" src="${f:transPicUrl(img.url500x500,300,img.height/(img.width/300))}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                            <c:if test="${img.width<=300}">
                                                                <img width="150" height="<fmt:formatNumber value="${(img.height/(img.width/300))/2}" pattern="#"></fmt:formatNumber>" src="${f:transPicUrl(img.url500x500,300,img.height/(img.width/300))}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                        </c:if>
                                                        <c:if test="${img.height>=90}">
                                                            <c:if test="${img.width>300}">
                                                                <img width="150" height="<fmt:formatNumber value="${(img.height/(img.width/300))/2}" pattern="#"></fmt:formatNumber>"  src="${f:transPicUrl(img.url500x500,300,img.height/(img.width/300))}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                            <c:if test="${img.width<=300}">
                                                                33  <img width="150" height="<fmt:formatNumber value="${(img.height/(img.width/300)/2)}" pattern="#"></fmt:formatNumber>" src="${f:transPicUrl(img.url500x500,300,img.height/(img.width/300))}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                        </c:if>
                                                    </c:if>
                                                    <c:if test="${img.width<img.height}">
                                                        <c:if test="${img.width<90}">
                                                            <c:if test="${img.height>300}">
                                                                <img width="45" height="150" src="${f:transPicUrl(img.url500x500,90,300)}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                            <c:if test="${img.height<=300}">
                                                                <img width="<fmt:formatNumber value="${(img.width/(img.height/300))/2}" pattern="#"></fmt:formatNumber>" height="150" src="${f:transPicUrl(img.url500x500,img.width/(img.height/300),300)}" data-meta="${img.url400x400}" alt="">
                                                            </c:if>
                                                        </c:if>
                                                        <c:if test="${img.width>=90}">
                                                            <img width="<fmt:formatNumber value="${(img.width/(img.height/300))/2}" pattern="#"></fmt:formatNumber>" height="150"  src="${f:transPicUrl(img.url500x500,img.width/(img.height/300),300)}" data-meta="${img.url400x400}" alt="">
                                                        </c:if>
                                                    </c:if>
                                                    <c:if test="${img.width==img.height}">
                                                        <img width="150" height="150" src="${f:transPicUrl(img.url500x500, 300, 300)}" data-meta="${img.url400x400}" alt="">
                                                    </c:if>
                                                </li>
                                            </c:forEach>

                                        </c:if>
                                    </ul>
                                </div>
                                <div class="ly"> 
                                    <i class="date"><fmt:formatDate value="${dynaInfo.createDate}" pattern="MM-dd HH:mm"/></i>
                                </div>
                            </div>
                            <!--评论输入框-->
                            <div class="comment" id="comment">
                                <!-- 登录提示层 -->
                                <a href="javascript:;" class="m-tips loginTip" id="JloginTip">要登录才能回复喔！</a> 
                                <!-- 评论输入 -->
                                <div class="c-input">
                                    <div class="c-top">
                                        <div class="c-face"><span class="c-face-btn"></span><span class="c-face-list"></span></div>
                                    </div>
                                    <div class="c-area">
                                        <input id="createDate" type="hidden" value="<fmt:formatDate value="${dynaInfo.createDate}" pattern="yyyy-MM-dd"></fmt:formatDate>"/>
                                        <textarea id="content" placeholder="评论"></textarea>
                                    </div>      
                                    <div class="c-btn"><span class="c-submit" id="cmtSubmit_pop" onclick ="ajaxReply();">发表</span></div>
                                </div>
                            </div>
                            <!-- 评论列表 -->
                            <div class="m-lylist">
                                <div id="JdataList"></div>
                                <p class="loading" id="Jloading">点击查看更多</p>
                            </div>       
                        </li>
                    </ul>
                </div>
            </div> 

            <!--隐藏评论输入框-->
            <div class="comment" id="comment_pop_detail"> 
                <!-- 评论输入 -->
                <div class="c-input" >
                    <div class="c-top">
                        <div class="c-face"><span class="c-face-btn"></span><span class="c-face-list"></span></div>
                    </div>
                    <div class="c-area">
                        <textarea id="content_pop" placeholder="评论"></textarea>
                    </div>      
                    <div class="c-btn"><span class="c-submit" id="cmtSubmit_pop" onclick="ajaxReplyToPerson(this);">发表</span></div>
                </div>
            </div>
            <!-- 提示层 -->
            <div class="m-tips" id="Jtips"></div>  
            <script type="text/javascript" src="http://js.3conline.com/wap/2013/common/js/zepto1.1.min.js" ></script>
            <script src="http://js.3conline.com/wap/common/swipe.extend-min.js"></script>
            <script>
                // 点击查看大图
                $(document).delegate('.picsBox img', 'click', function(e) {
                    var picArray=[], index, col=$(this).closest('.picsBox').find('img');
                    col.each(function() {
                        picArray.push($(this).attr('data-meta'));
                    });
                    index=col.index(this);
                    makeSwipe(picArray, index);
                });

                function makeSwipe(ary,idx){
                    var HTML='',div, fullPicSlider, sliderEle,
                    _windowHeight = document.documentElement.clientHeight,
                    _scrollTop = document.body.scrollTop;

                    idx=idx||0;
                    ary.forEach(function(item,idx){
                        HTML+='<div><img src2="{url}"></div>'.replace('{url}',item);
                    });
                    HTML='<div id="fullPicSlider"><div class="picwrap">'+HTML+'</div><div id="slidenum">123/123</div></div>';
                    div=document.createElement('div');
                    document.body.appendChild(div);
                    div.outerHTML=HTML;
                    sliderEle=document.getElementById('fullPicSlider');
                    sliderEle.addEventListener("touchmove", function(e){
                        if (e.touches.length>1){
                            e.preventDefault();
                        }
                    }, false);
                    fullPicSlider = swipe(sliderEle,{
                        startSlide:idx,
                        callback :render,
                        disableScroll :true
                    });
                    sliderEle.style.top=_scrollTop+'px';
                    sliderEle.onclick=delSwipe;

                    window.addEventListener('orientationchange',function(){
                        sliderEle.style.top=document.body.scrollTop+'px';
                    },false);

                    window.addEventListener('scroll',function(){
                        sliderEle.style.top=document.body.scrollTop+'px';
                    },false);
                    
                    function render(index, elem){
                        var total=ary.length;
                        document.getElementById('slidenum').innerHTML=(index*1+1)+'/'+total;

                        //elem.parentNode.style.height = (elem.clientHeight||elem.offsetHeight) + "px";
                    }

                    function delSwipe(){
                        var dom=document.getElementById('fullPicSlider');
                        fullPicSlider.kill();
                        dom.parentNode.removeChild(dom);
                    }

                }
            </script>
            <script>
                //事件绑定
                function touchEvent(elm,fn) {
                    if ("ontouchstart" in document.documentElement) {
                        elm.addEventListener("touchstart",fn,false);
                    }else {
                        elm.addEventListener("click",fn,false);
                    }
                }

                /*各种提示*/
                function showTips(msg){
                    var tips = document.getElementById('Jtips');
                    if(!tips) {
                        tips = document.createElement('div');
                        tips.id = 'Jtips';
                        tips.className = 'm-tips';
                        document.body.appendChild(tips);
                    }
                    tips.innerHTML = msg;
                    tips.style.display = 'block';
                    var tips_width = tips.clientWidth/2;
                    tips.style.marginLeft = '-'+tips_width+'px';
                    tips.style.opacity = 1;    
                    setTimeout(function(){
                        tips.style.webkitTransition = 'all 0.3s ease-in';
                        tips.style.opacity = 0;
                        tips.style.marginTop = '-80px';
                        setTimeout(function(){
                            tips.style.display = 'none';
                            tips.style.marginTop = '-40px';
                        }, 300);
                    }, 2000);
                }


                var isLogin = ${user!=null && user.uid!=0},isMember = ${isMember};
                //发表
                function joinIn(){
                    var joinBtn = document.getElementById("Jadd"),        
                    url = window.location.href;
                    if(!isLogin){//未登录
                        location.href = "${UCWAPROOT}/my/passport/login.jsp?return="+url;
                    }else{//登录
                        location.href = "detail.html";              
                    }
                }
                //发表或登录提示
                function check(){
                    var joinBtn = document.getElementById("Jadd"),
                    loginTip = document.getElementById("JloginTip"),
                    url = window.location.href;
                    if(isLogin && !isMember){//登录且非该车友会会员
                        if( joinBtn != null && joinBtn != undefined){
                            joinBtn.style.display = "none";
                        }
                    }
                    if(!isLogin){
                        loginTip.style.display = "block";
                        loginTip.href = "${UCWAPROOT}/passport/login.jsp?return="+url;
                    }else{//未登录
                        loginTip.style.display = "none";
                    }
                }
                check();


                //点击加载
                var count = 1,
                requestOff = false,
                loading = $("#Jloading"),
                container = $('#JdataList');
                function loader() {
                    if (!requestOff) {
                        var url = "${WAPROOT}/dyna/getReplyList.do?dynaInfoId=${dynaInfo.dynaInfoId}&isTransFace=1&source_agent=2&pageNo=" + count;
                        requestOff = true;
                        // 显示正在加载模块
                        loading.html("正在加载中...").show("slow");
                        // Ajax 翻页
                        $.ajax({
                            url: url,
                            type: "POST",
                            dataType: "json",
                            success: function(data) {
                                var list = data.list,
                                len = list.length;
                                if (len <= 0) {
                                    loading.show().html("亲>_<暂时没有数据哦~");
                                    return;
                                }
                                var html = "",
                                pageCount = data.pageCount;
                                for (var i = 0; i < len; i++) {
                                    var curData = list[i], 
                                    toReply =  curData.toReply,
                                    reply = toReply ? '回复<a href="'+curData.toReplyUrl+'" class="name">'+toReply+'</a>' : '';
                                    //数据列表   
                                    html += '<div class="lywrap" data-meta="'+curData.nickName+'" data-id="'+curData.userId+'">'
                                        +'<a href="'+curData.myIconUrl+'" class="txIcon">'
                                        +'<img src="'+curData.myIcon+'">'
                                        +'</a>'
                                        +'<div class="lyCon">'
                                        +'<p class="nameBox">'
                                        +'<span class="time">'+curData.time+'</span>'
                                        +'<a href="'+curData.myIconUrl+'" class="name">'+curData.nickName+'</a>' + reply
                                        +'</p>'
                                        +'<p class="say">'+curData.des+'</p>'
                                        +'</div>'
                                        +'<input type="hidden" value="'+curData.replyId+'" name="dynaInfoId"/><input type="hidden" name="createDate" value="'+curData.createDate+'"/>'
                                        +'</div>'
                                }
                                container.append(html);
                                loading.html("点击查看更多");
                                if (count >= pageCount) {
                                    requestOff = true;
                                    if(count > 1){
                                        loading.show().html("亲>_<暂时就这么多了哦~");	
                                    }else{
                                        loading.hide();
                                    }
                                    loading.unbind("click");
                                } else {
                                    requestOff = false;
                                }
                                count++;
                            }
                        });
                    }
                }
                loader();
                loading.bind("click", function() {
                    loader();
                });
            </script>
            <script type="text/javascript">
                var faceStr = '<img title="[抠鼻]" src="http://bbs.pcauto.com.cn/images/emot/em2001.gif" /><img title="[鼓掌]" src="http://www1.pcauto.com.cn/autobbs/2013/images/emot/em2002.gif" /><img title="[晕]" src="http://bbs.pcauto.com.cn/images/emot/em2005.gif" /><img title="[微笑]" src="http://bbs.pcauto.com.cn/images/emot/em2007.gif" /><img title="[流泪]" src="http://bbs.pcauto.com.cn/images/emot/em2008.gif" /><img title="[闭嘴]" src="http://bbs.pcauto.com.cn/images/emot/em2011.gif" /><img title="[鄙视]" src="http://bbs.pcauto.com.cn/images/emot/em2012.gif" /><img title="[吐]" src="http://bbs.pcauto.com.cn/images/emot/em2016.gif" /><img title="[奋斗]" src="http://bbs.pcauto.com.cn/images/emot/em2040.gif" /><img title="[疑问]" src="http://bbs.pcauto.com.cn/images/emot/em2044.gif" /><img title="[强]" src="http://bbs.pcauto.com.cn/images/emot/em2046.gif" />';
                var facelist = [
                    ['em2001','[抠鼻]'],
                    ['em2002','[鼓掌]'],
                    ['em2005','[晕]'],
                    ['em2007','[微笑]'],
                    ['em2008','[流泪]'],
                    ['em2011','[闭嘴]'],
                    ['em2012','[鄙视]'],
                    ['em2016','[吐]'],
                    ['em2040','[奋斗]'],
                    ['em2044','[疑问]'],
                    ['em2046','[强]']
                ];
                function tranFaceToBBS(str){
                    for(var i=facelist.length-1; i>=0; i--) {
                        p = new RegExp(facelist[i][1].replace('[', '\\[').replace(']', '\\]'), 'gm');
                        str = str.replace(p, '\['+facelist[i][0]+'\]');
                    }
                    return str;
                }
                /*留言*/
                (function(){
                    // 移动/切换显示回复框
                    function showPopForm(btn) {
                        var wrap = closest(btn, '.lywrap');
                        if(!wrap) return;
        
                        var cmt = document.getElementById('comment_pop_detail'),
                        metaData = wrap.getAttribute('data-meta'),
                        textArea = document.getElementById('content_pop');
                       
                        if(cmt.parentNode == wrap) {
                            // if already here, just toggle it
                            if(cmt.style.display == 'none') {               
                                cmt.style.display = 'block';
                                textArea.placeholder = "回复"+ metaData +"：";
                            } else if(cmt.style.display == 'block') {
                                cmt.style.display = 'none';
                            }                
                        } else {           
                            // move comment_pop here
                            wrap.appendChild(cmt);
                            cmt.className = "comment";
                            cmt.style.display = 'block';
            
                            // placeholder
                            textArea.value = "";            
                            textArea.placeholder = "回复"+ metaData +"：";
                        }
                    }
                    // selector 只能用简单的选择器，#id, tagName, .className，单个无组合
                    function closest(ele, selector) {
                        var result,
                        tmp = ele.parentNode;

                        while (tmp) {
                            if (matchSelector(tmp, selector)) {
                                result = tmp;
                                break;
                            }
                            tmp = tmp.parentNode;
                        }
                        return result;
                    }
                    function matchSelector(ele, selector) {
                        // if use id
                        if (selector.charAt(0) === '#') {
                            return ele.id === selector.slice(1);
                        }
                        // if use class
                        if (selector.charAt(0) === '.') {
                            return (' ' + ele.className + ' ').indexOf(' ' + selector.slice(1) + ' ') != -1;
                        }
                        // if use tagName
                        return ele.tagName.toLowerCase() === selector.toLowerCase();
                    }
                    // ============ 简单的事件委托
                    function delegateEvent(interfaceEle, selector, type, fn) {
                        interfaceEle.addEventListener(type, function(e) {
                            if (matchSelector(e.target, selector)) {
                                if(fn) {
                                    fn.call(e.target, e);
                                }
                            }
                        });
                    }
                    // 事件绑定
                    var mainEle = document.getElementById('J-main');
                    // 切换显示表情
                    function toggleFace(faceBtn) {
                        var cmt = closest(faceBtn, '.comment');
                        if(cmt) {
                            cmt.className = cmt.className == 'comment face-open' ? 'comment' : 'comment face-open';
                        }
                    }
                    // 触发切换显示表情
                    var faceBtns = document.querySelectorAll('.comment .c-face-btn');
                    for(var i=faceBtns.length - 1; i >= 0; i--) {
                        (function(n){
                            var item = faceBtns[n];
                            item.addEventListener('click', function(e){
                                var parentNode = item.parentNode,
                                listObj = parentNode.querySelector(".c-face-list");
                                if(listObj.children.length==0){
                                    listObj.innerHTML = faceStr;
                                }
                                toggleFace(item, '.comment');
                            });
                        })(i);          
                    }

                    // 点击表情, append title(ubb code)
                    var faceList = Array.prototype.slice.call(document.querySelectorAll('.comment .c-face-list'));
                    faceList.forEach(function(item){
                        var imgs = item.getElementsByTagName('img');
                    
                        delegateEvent(item, 'img', 'click', function(){
                            // show clicking which face
                            var that = this;
                            that.className = 'hlight';
                            setTimeout(function(){
                                that.className = '';
                            }, 300);
            
                            var cmt = closest(this, '.comment');
                            if(cmt) {
                                var textArea = cmt.querySelector('textarea');
                                if(textArea) {
                                    textArea.value += this.title;
                                }
                            }
                        });
                    });    
    
                    // 点击回复内容    
                    delegateEvent(mainEle, '.say', 'click', function(e){
                        var url = window.location.href,
                        cmtNum = this.innerHTML;
                        if(!isLogin){//未登录
                            location.href = "http://m.pcauto.com.cn/my/passport/login.jsp?return="+url;
                        }else{//登录
                            if($(e.target).parents(".lywrap").attr("data-id")!=${user.uid}){
                                showPopForm(this);     
                            }
                        }    
                    });

                })()
                var isSend = 0;
                function ajaxReply(){
                    var createDate = $("#createDate").val();
                    var content = $("#content").val();
                    if(content=="" || content.length==0){
                        showTips("请输入回复内容");
                        return false;
                    }
                    if(content.length>150){
                        showTips("回复内容长度不能超过150");
                        return;
                    }
                    if(isSend==1){
                        return;
                    }
                    isSend = 1;
                    $.ajax({
                        url:"${WAPROOT}/dyna/replyDyna.do",
                        data:{
                            clubId:"${clubId}",
                            dynaInfoId:"${dynaInfo.dynaInfoId}",
                            postToDynaReplyId:0,
                            createDate:createDate,
                            content:tranFaceToBBS(content)
                        },
                        dataType:"json",
                        type:"post",
                        success:function(data){
                            isSend=0;
                            if(data.code==0){
                                showTips("发表成功");
                                $("#comment").removeClass("face-open");
                                $("#content").val("");
                                $("#Jloading").hide();
                                addReplyToHtml(data.data);
                            }else{
                                showTips(data.message);
                            }
                        },
                        error:function(xmlHttpRequest, textStatus, errorThrown){
                            isSend = 0;
                            var message = "网络错误,请联系管理员";
                            if(xmlHttpRequest.status==503){
                                var json = eval("("+xmlHttpRequest.responseText+")");
                                message = (json.message == ""?"网络错误,请联系管理员":json.message);
                            }
                            showTips(message);
                        }
                    });
                }
                function ajaxReplyToPerson(e){
                    var createDate =$(e).parents(".lywrap").find("input[name='createDate']").val();
                    var postToDynaReplyId=$(e).parents(".lywrap").find("input[name='dynaInfoId']").val();
                    var content = $("#content_pop").val();
                    if(content=="" || content.length==0){
                        showTips("请输入回复内容");
                        return false;
                    }
                    if(content.length>150){
                        showTips("回复内容长度不能超过150");
                        return false;
                    }
                    if(isSend==1){
                        return;
                    }
                    isSend=1;
                    $.ajax({
                        url:"${WAPROOT}/dyna/replyDyna.do",
                        data:{
                            clubId:"${clubId}",
                            dynaInfoId:"${dynaInfo.dynaInfoId}",
                            postToDynaReplyId:postToDynaReplyId,
                            createDate:createDate,
                            content:tranFaceToBBS(content)
                        },
                        dataType:"json",
                        type:"post",
                        success:function(data){
                            isSend=0;
                            if(data.code==0){
                                showTips("发表成功");
                                $("#comment").removeClass("face-open");
                                $("#comment_pop").hide();
                                $("#content_pop").val("");
                                addReplyToHtml(data.data);
                                $("#comment_pop_detail").hide();
                            }else{
                                showTips(data.message);
                            }
                        },
                        error:function(xmlHttpRequest, textStatus, errorThrown){
                            isSend = 0;
                            var message = "网络错误,请联系管理员";
                            if(xmlHttpRequest.status==503){
                                var json = eval("("+xmlHttpRequest.responseText+")");
                                message = (json.message == ""?"网络错误,请联系管理员":json.message);
                            }
                            showTips(message);
                        }
                    });
                }
                function addReplyToHtml(data){
                    var curData = data, 
                    toReply =  curData.postToDynaReplyId>0,
                    reply = toReply ? '回复<a href="${UCWAPROOT}/'+curData.postToUserId+'/" class="name">'+curData.postToUserName+'</a>' : '';

                    //数据列表   
                    var html = '<div class="lywrap" data-meta="'+curData.username+'" data-id="'+curData.userId+'">'
                        +'<a href="${UCWAPROOT}/'+curData.userId+'/" class="txIcon">'
                        +'<img src="'+curData.myIcon+'">'
                        +'</a>'
                        +'<div class="lyCon">'
                        +'<p class="nameBox">'
                        +'<span class="time">'+curData.time+'</span>'
                        +'<a href="${UCWAPROOT}/'+curData.userId+'/" class="name">'+curData.username+'</a>' + reply
                        +'</p>'
                        +'<p class="say">'+curData.showContent+'</p>'
                        +'</div>'
                        +'<input type="hidden" value="'+curData.replyId+'" name="dynaInfoId"/><input type="hidden" name="createDate" value="'+curData.showCreateDate+'"/>'
                        +'</div>'
                                
                    $("#JdataList").prepend(html);
                }
                
            </script>
            <!-- 公共底部 --> 
            <%@include file="../common/intf5987.html" %>
            <!-- 公共底部end --> 
        </div>
    </body>
</html>